package com.iisageek.client.widgets.validationform;

import com.google.gwt.user.client.ui.Composite;

public abstract class VElement extends Composite {

	protected boolean required = true;
	
	private boolean valid = false;

	public abstract void setErrorMsg(String msg);

	public abstract void setErrorMsg(String msg, boolean errorExists);

	public abstract void validate();

	public abstract void setCellWidth(String size);

	public abstract String getError();
	
	public abstract void clear();
	
	public boolean isValid() {
		if (!required) {
			return valid;
		}
		return true;
	}
	
	public void setInvalid() {
		valid = false;
	}
	
	public void setValid() {
		valid = true;
	}
	
}
